package yang.simpleMain.rpcStudy.rmi.client;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.List;

import yang.simpleMain.rpcStudy.rmi.PersonEntity;
import yang.simpleMain.rpcStudy.rmi.server.PersonService;


public class RmiClient {

	public static void main(String[] args) throws MalformedURLException, RemoteException, NotBoundException {
		PersonService service = (PersonService) Naming.lookup("rmi://127.0.0.1:6600/PersonService");
		List<PersonEntity> personList=service.getList();
		for (PersonEntity person : personList) {
			System.out.println("ID:"+person.getId()+" Age:"+person.getAge()+" Name:"+person.getName());
		}
	}

}
